<template>
    <div style="width: 554px;height: 468px;overflow: hidden;" id="videoItem">

        <!--<gs:video-vod id="videoComponent" site="yncytz.gensee.com" ctx="webcast" fullscreen="true" uname="" :ownerid="ownerid"/>-->

    </div>
</template>

<script>
    export default {
        name: "videoDetail",
        data(){
            return {
                ownerid: 'b1c59c42151b479e8bf7a7353e435648'
            }
        },
        created() {
           let ownerid =  this.$route.query.ownerid ? this.$route.query.ownerid : 'b1c59c42151b479e8bf7a7353e43564';

            let mainIframe = document.getElementById('videoItem');
            mainIframe.innerHTML = `<gs:video-vod id="videoComponent" site="yncytz.gensee.com" ctx="webcast" fullscreen="true" uname="" ownerid="${ownerid}" />`;

            var script=document.createElement("script");
            script.type="text/javascript";
            script.src="http://static.gensee.com/webcast/static/sdk/js/gssdk-1.3.js?v=" + Date.now();
            document.getElementsByTagName('head')[0].appendChild(script);




            window.addEventListener('message',(e)=>{

                if(e.data.type == "repload"){
                    //window.location.replace("http://localhost:8081/experience/index.html#/videoDetail?ownerid=" + e.data.data)

                    //let url = "http://localhost:8081/experience/index.html#/videoDetail?ownerid=" + e.data.data;
                    location.reload();

                }

                //window.location.replace("http://localhost:8081/experience/index.html#/videoDetail?ownerid" + e.data)
                //window.location.href = "http://localhost:8081/experience/index.html#/videoDetail?ownerid" + e.data;

            })

        }
    }
</script>

<style scoped>

</style>